package com.gary.springcloud.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author pengrui
 * @date 2021/1/7 - 15:54
 */
@RestController
@Slf4j
public class OrderConsulController {

    public static final String INVOKE_URI = "http://cloud-provider-payment";

    @Resource
    private RestTemplate restTemplate;

    @GetMapping("/consumer/consul")
    public String queryConsul() {
        return restTemplate.getForObject(INVOKE_URI+"/payment/consul", String.class);
    }
}
